package com.example.zyfypt_206shj.fragement;

import android.content.Intent;
import android.support.v4.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.view.animation.LinearOutSlowInInterpolator;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.zyfypt_206shj.R;
import com.example.zyfypt_206shj.activity.activity_attention;
import com.example.zyfypt_206shj.activity.activity_collection;
import com.example.zyfypt_206shj.bean.SessionID;


/**
 * Created by Raindy on 2017/4/29.
 */

public class Fragment5 extends Fragment {
    private View view;
    private Context context;
    private LinearLayout layout_attention, layout_collection;
    private TextView tv_sessionid,tv_username,tv_realname,tv_rolename,tv_sex,tv_id;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        context=getActivity();
        view=inflater.inflate(R.layout.fragment5,container,false);
        init_me_layout();
        return view;
    }

    private void init_me_layout(){
        layout_attention = (LinearLayout) view.findViewById(R.id.layout_attention);
        layout_collection = (LinearLayout) view.findViewById(R.id.layout_collection);
        tv_sessionid = (TextView) view.findViewById(R.id.sessionid);
        tv_username = (TextView) view.findViewById(R.id.username);
        tv_realname = (TextView) view.findViewById(R.id.realname);
        tv_rolename = (TextView) view.findViewById(R.id.rolename);
        tv_sex = (TextView) view.findViewById(R.id.sex);
        tv_id = (TextView) view.findViewById(R.id.id);

        tv_sessionid.setText("SessionID：" + SessionID.sessionID);
        tv_username.setText("用 户  id ：" + SessionID.username);
        tv_realname.setText("用 户  名 ：" + SessionID.realname);
        tv_rolename.setText("真实姓名：" + SessionID.rolename);
        tv_sex.setText("角       色 ：" + SessionID.sex);
        tv_id.setText("姓       名 ：" + SessionID.id);

        layout_attention.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), activity_attention.class);
                startActivity(intent);
            }
        });

        layout_collection.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), activity_collection.class);
                startActivity(intent);
            }
        });
    }
}
